package factory

import "fmt"

type Product interface {
	Print()
}

type productA struct {
}

func (p *productA) Print() {
	fmt.Println("product A...")
}

type productB struct {
}

func (p *productB) Print() {
	fmt.Println("product B...")
}

func GetProduct(name string) Product {
	var p Product
	switch name {
	case "productA":
		p = &productA{}
	case "productB":
		p = &productB{}
	}
	return p
}
